<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/prettyphoto.css" rel="stylesheet" />
<link href="<?=Q::ini('custom_system/base_url')?>css/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/jq.autocomplete.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.mselect.js?"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.prettyphoto.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.autocomplete.js"></script>
<script type="text/javascript">
$(function(){
	$("a[rel^='pretty_photo']").prettyPhoto({theme:'facebook'});
	var product_categories_data = <?=$product_categories?>;
	$(document).mselect(product_categories_data, 'product_categories_id', 'product_categories_id', "<?=isset($product['product_categories_id']) ? $product['product_categories_id'] : 0?>");
	$("#q").autocomplete("<?=url('Product::BasicInfo/ProductInfoAjax')?>").result(function(event, data, formatted){
		if (data[1])
		{
			$("#id").val(data[1]);
		}
		else
		{
			$("#id").val('');
		}
	});
});
</script>
<form method="get">
<? include(Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
<table class="form_table">
<tr>
	<th>输查找编号</th>
	<td><input type="text" size="80" id="q" /></td>
	<td>
		<input type="hidden" name="id" id="id" value="" />
		<input type="submit" class="button" value="查询" />
	</td>
</tr>
</table>
</form>
<table class="form_table">
	<tr>
		<th>产品编号</th>
		<td><?=$product['number'];?></td>
	</tr>
	<tr>
		<th>产品名称</th>
	    <td><?=$product['name'];?></td>
	</tr>
	<tr>
		<th>产品分类</th>
		<td ><input type="hidden" id="product_categories_id" name="product_categories_id" /></td>
	</tr>
	<tr>
		<th>图片</th>
		<td>
			<?if ($product['pic_url']):?>
				<?$pretty_photo_number = 0;?>
				<?foreach ($product['pic_url'] as $pp):?>
				<a rel="pretty_photo[<?=$product['id']?>]" href="<?=$pp?>"><?if(!$pretty_photo_number):?><span class="img_icon"></span><?endif;?></a>
				<?$pretty_photo_number = 1;?>
				<?endforeach;?>
			<?endif;?>
		</td>
	</tr>
	<tr>
		<th>产品重量(g)</th>
		<td><?=$product['weight'];?></td>
	</tr>
	<tr>
		<th>备注</th>
		<td><textarea disabled="disabled" name="notes" rows="5" cols="23"><?=isset($product['notes']) ? $product['notes'] : ''?></textarea></td>
	</tr>
</table>
<?=$this->_endblock(); ?>